package com.atguigu03.threadsafe.notsafe;

/**
 * ClassName: WindowsTest
 * Package: com.atguigu03.threadsafe.notsafe
 * Description:
 *
 * @Author BuTang
 * @Create 2023/5/14 22:22
 * @Version 1.0
 */
public class WindowsTest {
    public static void main(String[] args) {
        Windows1 a = new Windows1();
        Windows1 b = new Windows1();
        Windows1 c = new Windows1();

        a.setName("线程1");
        b.setName("线程2");
        c.setName("线程3");

        a.start();
        b.start();
        c.start();
    }
}

class Windows1 extends Thread {
    static int ticket = 100;

    @Override
    public void run() {
        for (int i  = ticket; i > 0 ; i--) {
            System.out.println(Thread.currentThread().getName() +"--"+ i);
        }
    }
}
